using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialStatisticsTools._ModelingSpatialRelationships
{
    /// <summary>
    /// <para>Spatial Association Between Zones</para>
    /// <para>Measures the degree of spatial association between two regionalizations of the same study area in which each regionalization is composed of a set of categories, called zones.  The association between the regionalizations is determined by the area overlap between zones of each regionalization. The association is highest when each zone of one regionalization closely corresponds to a zone of the other regionalization.  Similarly, spatial association is lowest when the zones of one regionalization have large overlap with many different zones of the other regionalization.   The primary output of the tool is a global measure of spatial association between the categorical variables: a single number ranging from 0 (no correspondence) to 1 (perfect spatial alignment of zones). Optionally, this global association can be calculated and visualized for specific zones of either regionalization or for specific combinations of zones between regionalizations.</para>
    /// <para>测量同一研究区域的两个区域化之间的空间关联程度，其中每个区域化由一组类别（称为区域）组成。 区域化之间的关联由每个区域化区域之间的区域重叠决定。当一个区域化的每个区域与另一个区域化的区域紧密对应时，关联度最高。 同样，当一个区域化的区域与另一个区域化的许多不同区域有很大的重叠时，空间关联度最低。  该工具的主要输出是分类变量之间空间关联的全局度量：从 0（无对应关系）到 1（区域的完美空间对齐）的单个数字。或者，可以针对区域化的特定区域或区域化之间的特定区域组合来计算和可视化此全局关联。</para>
    /// </summary>    
    [DisplayName("Spatial Association Between Zones")]
    public class SpatialAssociationBetweenZones : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SpatialAssociationBetweenZones()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_feature_or_raster">
        /// <para>Input Polygon Feature or Raster Zones</para>
        /// <para>The dataset representing the zones of the first regionalization. The zones can be defined using polygon features or a raster.</para>
        /// <para>表示第一个区域化区域的数据集。可以使用面要素或栅格来定义区域。</para>
        /// </param>
        /// <param name="_categorical_zone_field">
        /// <para>Categorical Zone Field</para>
        /// <para>The field representing the zone category of the input zones. Each unique value of this field defines an individual zone. For features, the field must be integer or text. For rasters, the VALUE field is also supported.</para>
        /// <para>表示输入区域的区域类别的字段。此字段的每个唯一值都定义一个单独的区域。对于要素，字段必须为整数或文本。对于栅格，还支持 VALUE 字段。</para>
        /// </param>
        /// <param name="_overlay_feature_or_raster">
        /// <para>Overlay Polygon Feature or Raster Zones</para>
        /// <para>The dataset representing the zones of the second regionalization. The zones can be polygon features or a raster.</para>
        /// <para>表示第二次区域化区域的数据集。区域可以是面要素，也可以是栅格。</para>
        /// </param>
        /// <param name="_categorical_overlay_zone_field">
        /// <para>Categorical Overlay Zone Field</para>
        /// <para>The field representing the zone category of the overlay zones. Each unique value of this field defines an individual zone. For features, the field must be integer or text. For rasters, the VALUE field is also supported.</para>
        /// <para>表示叠加区域的区域类别的字段。此字段的每个唯一值都定义一个单独的区域。对于要素，字段必须为整数或文本。对于栅格，还支持 VALUE 字段。</para>
        /// </param>
        public SpatialAssociationBetweenZones(object _input_feature_or_raster, object _categorical_zone_field, object _overlay_feature_or_raster, object _categorical_overlay_zone_field)
        {
            this._input_feature_or_raster = _input_feature_or_raster;
            this._categorical_zone_field = _categorical_zone_field;
            this._overlay_feature_or_raster = _overlay_feature_or_raster;
            this._categorical_overlay_zone_field = _categorical_overlay_zone_field;
        }
        public override string ToolboxName => "Spatial Statistics Tools";

        public override string ToolName => "Spatial Association Between Zones";

        public override string CallName => "stats.SpatialAssociationBetweenZones";

        public override List<string> AcceptEnvironments => ["cellSize", "cellSizeProjectionMethod", "extent", "mask", "outputCoordinateSystem", "snapRaster"];

        public override object[] ParameterInfo => [_input_feature_or_raster, _categorical_zone_field, _overlay_feature_or_raster, _categorical_overlay_zone_field, _output_features, _output_raster, _correspondence_overlay_to_input, _correspondence_input_to_overlay, _global_measure_of_spatial_association, _global_correspondence_input_to_overlay, _global_correspondence_overlay_to_input];

        /// <summary>
        /// <para>Input Polygon Feature or Raster Zones</para>
        /// <para>The dataset representing the zones of the first regionalization. The zones can be defined using polygon features or a raster.</para>
        /// <para>表示第一个区域化区域的数据集。可以使用面要素或栅格来定义区域。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Polygon Feature or Raster Zones")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_feature_or_raster { get; set; }


        /// <summary>
        /// <para>Categorical Zone Field</para>
        /// <para>The field representing the zone category of the input zones. Each unique value of this field defines an individual zone. For features, the field must be integer or text. For rasters, the VALUE field is also supported.</para>
        /// <para>表示输入区域的区域类别的字段。此字段的每个唯一值都定义一个单独的区域。对于要素，字段必须为整数或文本。对于栅格，还支持 VALUE 字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Categorical Zone Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _categorical_zone_field { get; set; }


        /// <summary>
        /// <para>Overlay Polygon Feature or Raster Zones</para>
        /// <para>The dataset representing the zones of the second regionalization. The zones can be polygon features or a raster.</para>
        /// <para>表示第二次区域化区域的数据集。区域可以是面要素，也可以是栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Overlay Polygon Feature or Raster Zones")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _overlay_feature_or_raster { get; set; }


        /// <summary>
        /// <para>Categorical Overlay Zone Field</para>
        /// <para>The field representing the zone category of the overlay zones. Each unique value of this field defines an individual zone. For features, the field must be integer or text. For rasters, the VALUE field is also supported.</para>
        /// <para>表示叠加区域的区域类别的字段。此字段的每个唯一值都定义一个单独的区域。对于要素，字段必须为整数或文本。对于栅格，还支持 VALUE 字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Categorical Overlay Zone Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _categorical_overlay_zone_field { get; set; }


        /// <summary>
        /// <para>Output Features</para>
        /// <para><xdoc>
        ///   <para>The output polygon features containing spatial association measures at all intersections of the input and overlay zones.</para>
        ///   <para>The output features can be used to measure the association between specific combinations of input and overlay zones, such as the association between areas of corn production (crop type) and areas of well-drained soil (soil drainage class). This parameter is only enabled if the input and overlay zones are both polygon features.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出面要素包含输入区域和叠加区域所有交点处的空间关联测量值。</para>
        ///   <para>输出要素可用于测量输入区和叠加区特定组合之间的关联，例如玉米生产区域（作物类型）与排水良好的土壤区域（土壤排水等级）之间的关联。仅当输入区域和叠加区域均为面要素时，才会启用此参数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _output_features { get; set; } = null;


        /// <summary>
        /// <para>Output Raster</para>
        /// <para><xdoc>
        ///   <para>The output raster containing spatial association measures between the input and overlay zones.</para>
        ///   <para>The output raster will have three fields to indicate the spatial association measures for intersections of the input and overlay zones, correspondence of overlay zones within input zones, and correspondence of input zones within overlay zones. This parameter is only enabled if at least one of the input and overlay zones is a raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含输入区域和叠加区域之间的空间关联测量的输出栅格。</para>
        ///   <para>输出栅格将具有三个字段，用于指示输入区域和叠加区域相交的空间关联度量、输入区域内叠加区域的对应关系以及叠加区域内输入区域的对应关系。仅当至少有一个输入区域和叠加区域为栅格时，才会启用此参数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _output_raster { get; set; } = null;


        /// <summary>
        /// <para>Correspondence of Overlay Zones within Input Zones</para>
        /// <para><xdoc>
        ///   <para>The output polygon features containing the correspondence measures of the overlay zones within the input zones.</para>
        ///   <para>This output will have the same geometry as the input zones and can be used to identify which input zones closely correspond overall to the overlay zones. Specific zone combinations can then be investigated with the output features. This parameter is only enabled if the input and overlay zones are both polygon features.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出面要素，包含输入区域内叠加区域的对应测量值。</para>
        ///   <para>此输出将具有与输入区域相同的几何形状，可用于识别哪些输入区域总体上与叠加区域紧密对应。然后，可以使用输出特征研究特定区域组合。仅当输入区域和叠加区域均为面要素时，才会启用此参数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Correspondence of Overlay Zones within Input Zones")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _correspondence_overlay_to_input { get; set; } = null;


        /// <summary>
        /// <para>Correspondence of Input Zones within Overlay Zones</para>
        /// <para><xdoc>
        ///   <para>The output polygon features containing the correspondence measures of the input zones within the overlay zones.</para>
        ///   <para>This output will have the same geometry as the overlay zones and can be used to identify which overlay zones closely correspond overall to the input zones. Specific zone combinations can then be investigated with the output features. This parameter is only enabled if the input and overlay zones are both polygon features.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出面要素，包含叠加区域内输入区域的对应测量值。</para>
        ///   <para>此输出将具有与叠加区域相同的几何形状，可用于识别哪些叠加区域总体上与输入区域紧密对应。然后，可以使用输出特征研究特定区域组合。仅当输入区域和叠加区域均为面要素时，才会启用此参数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Correspondence of Input Zones within Overlay Zones")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _correspondence_input_to_overlay { get; set; } = null;


        /// <summary>
        /// <para>Global Measure of Spatial Association</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Global Measure of Spatial Association")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _global_measure_of_spatial_association { get; set; }


        /// <summary>
        /// <para>Global Correspondence of Input Zones within Overlay Zones</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Global Correspondence of Input Zones within Overlay Zones")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _global_correspondence_input_to_overlay { get; set; }


        /// <summary>
        /// <para>Global Correspondence of Overlay Zones within Input Zones</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Global Correspondence of Overlay Zones within Input Zones")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _global_correspondence_overlay_to_input { get; set; }


        public SpatialAssociationBetweenZones SetEnv(object cellSize = null, object extent = null, object mask = null, object outputCoordinateSystem = null, object snapRaster = null)
        {
            base.SetEnv(cellSize: cellSize, extent: extent, mask: mask, outputCoordinateSystem: outputCoordinateSystem, snapRaster: snapRaster);
            return this;
        }

    }

}